<meta charset="UTF-8">
<div style="width:300px;height:300px;background:red;" id="d1">
    <div style="width:150px;height:150px;background:green;" id="d2">
        <div style="width:50px;height:50px;background:blue;" id="d3"></div>
    </div>
</div>

<script>
d1.addEventListener("click",function(){alert(1);});
d2.addEventListener("click",function(){alert(2);});
d3.addEventListener("click",function(e){alert(3);e.stopPropagation();});
</script>
